﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Devfw.OpenAuth
{
    /// <summary>
    /// Comparer class used to perform the sorting of the query parameters
    /// </summary>
    public class ParameterComparer : IComparer<Parameter>
    {
        #region IComparer<QueryParameter> Members

        public int Compare( Parameter x, Parameter y )
        {
            if( x.Name == y.Name )
            {
                return string.Compare( x.Value, y.Value );
            }
            else
            {
                return string.Compare( x.Name, y.Name );
            }
        }

        #endregion
    }
}
